home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / inn1.000 / inn1.4sec-linux-src.tar / inn / MakeRnews < prev    next >
Text File  |  1992-07-24  |  3KB  |  104 lines

  1. #! /bin/sh
  2. ##  $Revision: 1.6 $
  3. ##  Script to build an easy-to-ship single directory that contains
  4. ##  everything needed to build rnews on a machine.
  5.  
  6. ##  Optional first argument is the destination architecture, like "sun4"
  7. DIR=rnews.${1-dist}
  8. if [ -d ${DIR} ] ; then
  9.     echo ${DIR} exists!
  10.     exit 1
  11. fi
  12. mkdir ${DIR}
  13.  
  14. ##  Copy the files.
  15. for I in \
  16.     config/subst.c config/subst.sh config/config.data \
  17.     doc/rnews.1 doc/inn.conf.5 frontends/rnews.c \
  18.     include/clibrary.h include/configdata.h include/libinn.h \
  19.     include/logging.h include/macros.h include/mydir.h include/mystring.h \
  20.     include/mymemory.h include/nntp.h include/paths.h \
  21.     lib/closeonexec.c lib/findheader.c lib/getconfig.c lib/getfqdn.c \
  22.     lib/localopen.c lib/remopen.c lib/sendarticle.c lib/sendpass.c \
  23.     lib/strerror.c lib/waitnb.c lib/xmemerr.c lib/xmalloc.c \
  24.     lib/xrealloc.c \
  25.     site/inn.conf site/passwd.nntp ; do \
  26.     cp $I ${DIR}
  27. done
  28.  
  29. ##  Write the Makefile.  We duplicate the RCS revision string of the
  30. ##  script into the Makefile on purpose.
  31. cat <<\EOF >${DIR}/Makefile
  32. ##  $Revision: 1.6 $
  33. SHELL    = /bin/sh
  34. MAKE    = make
  35.  
  36. ##  Configuration dependencies -- edit as appropriate
  37. DEFS    =
  38. CFLAGS    = $(DEFS) -g
  39. LDFLAGS    = -Bstatic
  40. LINTFLAGS=-b -h $(DEFS)
  41.  
  42. ##  Manual pages -- install as appropriate for your system
  43. DOC    = rnews.1 inn.conf.5
  44.  
  45. ##  Configuration files -- install in /usr/lib/news
  46. CONF    = inn.conf passwd.nntp
  47.  
  48. ##  Program sources.
  49. HEADERS    = \
  50.     clibrary.h configdata.h libinn.h macros.h nntp.h paths.h
  51. SOURCES    = \
  52.     closeonexec.c findheader.c getconfig.c getfqdn.c localopen.c \
  53.     remopen.c rnews.c sendarticle.c sendpass.c strerror.c waitnb.c \
  54.     xmalloc.c xmemerr.c xrealloc.c
  55. OBJECTS    = \
  56.     closeonexec.o findheader.o getconfig.o getfqdn.o localopen.o \
  57.     remopen.o rnews.o sendarticle.o sendpass.o strerror.o waitnb.o \
  58.     xmalloc.o xmemerr.o xrealloc.o
  59.  
  60. ##  First target, just compile everything.
  61. all:        rnews $(DOC) $(CONF)
  62.     date >all
  63.  
  64. ##  Edit these lines as appropriate for your system
  65. install:    all
  66.     cp rnews /usr/bin/rnews
  67.     cp $(CONF) /usr/lib/news
  68.     cp rnews.1 /usr/man/man1
  69.     cp inn.conf.5 /usr/man/man5
  70.  
  71. ##  Clean up, remove non-essentials.
  72. clobber clean:
  73.     rm -f rnews core tags lint a.out *.o
  74.  
  75. lint:           rnews
  76.     lint $(LINTFLAGS) $(SOURCES) >lint
  77.  
  78. rnews:        $(OBJECTS)
  79.     rm -f rnews
  80.     $(CC) $(LDFLAGS) -o rnews $(CFLAGS) $(OBJECTS)
  81.  
  82. subst:        subst.c subst.sh
  83.     make c || make sh || { rm -f subst ; echo Failed 1>&2 ; }
  84.  
  85. config:        subst config.data $(DOC) $(HEADERS) Makefile
  86.     ./subst -f config.data $(DOC) $(HEADERS) Makefile
  87.     date >config
  88.  
  89. c:
  90.     @rm -f subst
  91.     $(CC) -o subst subst.c
  92. sh:
  93.     @rm -f subst
  94.     cp subst.sh subst
  95.     chmod +x subst
  96.  
  97. ##  Dependencies.  Default list, below, is probably good enough.
  98. depend:         Makefile $(SOURCES)
  99.     makedepend $(DEFS) $(SOURCES)
  100.  
  101. # DO NOT DELETE THIS LINE -- make depend depends on it.
  102. $(OBJECTS):    $(HEADERS)
  103. EOF
  104.